
cbuffer cbPerObject : register( b0 )
{
    matrix      g_mWorldViewProjection  : packoffset( c0 );
};

struct VS_In
{
    uint    id      	: SV_VERTEXID;
};

struct VS_Out
{
    float4 pos			: SV_POSITION;
    float4 color        : COLOR;
};


cbuffer cbImmutable
{
    static float4 g_positions[6] =
    {
        float4( 0.0f, 0.0f, 0.0f, 1.0f ),
        float4( 1.0f, 0.0f, 0.0f, 1.0f ),
        float4( 0.0f, 0.0f, 0.0f, 1.0f ),
        float4( 0.0f, 1.0f, 0.0f, 1.0f ),
        float4( 0.0f, 0.0f, 0.0f, 1.0f ),
        float4( 0.0f, 0.0f, 1.0f, 1.0f ),        
    };

    static float4 g_colors[6] =
    {
        float4( 1.0f, 0.0f, 0.0f, 1.0f ),
        float4( 1.0f, 0.0f, 0.0f, 1.0f ),
        float4( 0.0f, 1.0f, 0.0f, 1.0f ),
        float4( 0.0f, 1.0f, 0.0f, 1.0f ),
        float4( 0.0f, 0.0f, 1.0f, 1.0f ),
        float4( 0.0f, 0.0f, 1.0f, 1.0f ),        
    };
};

VS_Out VSMain(VS_In input)
{
    VS_Out output;
    
    output.pos = mul( g_positions[input.id] * 5, g_mWorldViewProjection );
    output.color = g_colors[input.id];
    return output;
}

float4 PSMain(VS_Out input) : SV_Target
{   
    return input.color;
    return float4( 1.0f, 1.0f, 0.0f, 1.0f );
}

